package org.example.JVM.Proxy.JDK;

import com.sun.deploy.net.HttpRequest;
import com.sun.deploy.net.HttpResponse;
import com.sun.deploy.net.MessageHeader;

import java.io.BufferedInputStream;
import java.net.URL;

/**
 * @description:
 * @author: farprt
 * @create: 2022-12-06 20:33
 **/
public class HttpRequestTemplateImpl implements HttpRequestTemplate{
    @Override
    public HttpResponse doGet(HttpRequest httpRequest) {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return new HttpResponse() {
            @Override
            public URL getRequest() {
                return null;
            }

            @Override
            public int getStatusCode() {
                return 0;
            }

            @Override
            public int getContentLength() {
                return 0;
            }

            @Override
            public long getExpiration() {
                return 0;
            }

            @Override
            public long getLastModified() {
                return 0;
            }

            @Override
            public String getContentType() {
                return null;
            }

            @Override
            public String getResponseHeader(String s) {
                return null;
            }

            @Override
            public BufferedInputStream getInputStream() {
                return null;
            }

            @Override
            public void disconnect() {

            }

            @Override
            public String getContentEncoding() {
                return null;
            }

            @Override
            public MessageHeader getHeaders() {
                return null;
            }
        };
    }

    @Override
    public HttpResponse doPost(HttpRequest httpRequest) {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return new HttpResponse() {
            @Override
            public URL getRequest() {
                return null;
            }

            @Override
            public int getStatusCode() {
                return 0;
            }

            @Override
            public int getContentLength() {
                return 0;
            }

            @Override
            public long getExpiration() {
                return 0;
            }

            @Override
            public long getLastModified() {
                return 0;
            }

            @Override
            public String getContentType() {
                return null;
            }

            @Override
            public String getResponseHeader(String s) {
                return null;
            }

            @Override
            public BufferedInputStream getInputStream() {
                return null;
            }

            @Override
            public void disconnect() {

            }

            @Override
            public String getContentEncoding() {
                return null;
            }

            @Override
            public MessageHeader getHeaders() {
                return null;
            }
        };
    }
}